<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>10_DOM事件监听</title>
</head>
<body>
    <button onclick="alert('最近降温,注意保暖!')">弹出警告窗</button>
<button id="btn">我是按钮</button>
    <script>
        let buttonE = document.getElementById('btn');
        buttonE.addEventListener('click',function (){
            alert('哈哈哈,点我了吧~')
        })
    </script>
</body>
</html>